﻿// owner 蒋家伟

#pragma once
#include "WeakReference.h"
#include "DataSchema_home.h"

namespace jsdk
{
    class IDocument;
    class ElementId;
    class IElementBasicInfomation;
    class IExternalDataComponent;
}

namespace jsdk
{
    // 类别描述 : 对象的公共基类
    class DATASCHEMA_EXPORT IElement : public WeakReference
    {
        DEFINE_DRIVER_BASE(IElement)
    public:
        virtual ~IElement() {}
#pragma region 通用
        /// \ brief 获取当前对象所在的文档
        virtual const IDocument* getDocument() const = 0;
        virtual IDocument* getDocument() = 0;

        /// \ brief 获取当前对象的ID
        virtual ElementId getElementId() const = 0;

#pragma region 通用

#pragma region 组件
        /// \ brief 获取Element基本信息
        virtual const IElementBasicInfomation* getBasicInfomation() const = 0;
        virtual IElementBasicInfomation* getBasicInfomation() = 0;
#pragma region 组件

#pragma region 内部（由框架内部调用）
    private:
        friend class Document;
        virtual void setDocument(IDocument* pDoc) = 0;
        virtual void setElementId(const ElementId& elementId) = 0;
        virtual void setComponentOwnerElement() = 0;
#pragma region 内部（由框架内部调用）

    };
}
